<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
    <link th:href="@{/bootstrap/css/bootstrap.min.css}" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row justify-content-center mt-5">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">用户登录</div>
                <div class="card-body">
                    <div th:if="${message}" th:class="${#strings.contains(message, '成功') ? 'alert alert-success' : 'alert alert-danger'}" role="alert">
                        <span th:text="${message}"></span>
                    </div>
                    <form action="#" th:action="@{/userLogin}" method="post">
                        <div class="form-group">
                            <label for="username">用户名</label>
                            <input type="text" class="form-control" id="username" name="username" th:value="${username}" placeholder="请输入用户名" required>
                        </div>
                        <div class="form-group">
                            <label for="password">密码</label>
                            <input type="password" class="form-control" id="password" name="password" th:value="${password}" placeholder="请输入密码" required>
                        </div>
                        <button type="submit" class="btn btn-primary w-100 mt-3">登录</button>
                    </form>
                    <div class="mt-3 text-center">
                        <a th:href="@{/userRegister}">没有账号？去注册</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
</body>
</html>